# -*- coding: UTF-8 -*-
# 作者： 磊
# @Time：2022/5/4
# coding=utf-8
import allure
import pytest as pytest
import requests


class TestSecondRequest1:

    def test_get_toke(self):
        url="https://api.weixin.qq.com/cgi-bin/token"
        params={
            'appid': 'wx74a8627810cfa308',
            'secret': 'e40a02f9d79a8097df497e6aaf93ab80',
            'grant_type': 'client_credential'
        }
        req=requests.get(url=url,params=params)

        #返回字符串格式数据
        print("返回字符串格式数据：",req.text)

        #返回字节格式数据
        print("返回字节格式数据：",req.content)

        # 返回字典格式数据
        print("返回字典格式数据：",req.json())

        # 状态码
        print(req.status_code)

        # 返回状态信息
        print(req.reason)

        print(req.cookies)

        print(req.encoding)

        print(req.headers)

        print("请求的信息：",req.request.headers)




if __name__ == '__main__':
        pytest.main(['-vs',"test01.py"])




